<script>
    $(function () {

        //获得浏览器参数
        $.extend({
            getUrlVars: function () {
                var vars = [], hash;
                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
                for (var i = 0; i
                < hashes.length; i++) {
                    hash = hashes[i].split('=');
                    vars.push(hash[0]);
                    vars[hash[0]] = hash[1];
                }
                return vars;
            },
            getUrlVar: function (name) {
                return $.getUrlVars()[name];
            }
        });

        //封装浏览器参数
        var composeUrlParams = function () {
            var param = '';
            $.each($.getUrlVars(), function (i, item) {
                if (item != 'p') {
                    var val = $.getUrlVar(item);
                    if (val) param += "&" + item + "=" + val;
                }
            });
            return param;
        }

        //分页功能
        $('.twbsPagination').twbsPagination({
            totalPages: <%= page.pageCount %>,
            visiblePages: 10,
            href: '/system/operation_log?num={{number}}'
        });
    })
</script>
<ol class="breadcrumb">
    <li><a href="#">奇妙云箱</a></li>
    <li>操作记录</li>
</ol>
<div class="panel panel-default">
    <div class="panel-heading">
        <span class="glyphicon glyphicon-list"></span>
        <span class="panel-title">日志列表</span>
    </div>
    <div class="table-responsive">
        <table class="table table-hover table-striped">
            <thead>
            <tr>
                <th>操作用户</th>
                <th>操作内容</th>
                <th>操作时间</th>
                <th>箱子ID</th>
            </tr>
            </thead>
            <tfoot>
            <tr>
                <td colspan="7">
                    <nav class="twbsPagination"></nav>
                </td>
            </tr>
            </tfoot>
            <tbody>
            <% for(var i = 0;i < datas.length;i++){ %>
            <tr>
                <td><%= datas[i].user %></td>
                <td><%= datas[i].operation %></td>
                <td><%= dates[i] %></td>
                <td><%= datas[i].box_id %></td>
            </tr>
            <% } %>
            </tbody>
        </table>
    </div>
</div>